#include <stdio.h>
#include <stdlib.h>

#define LEN 1000
#define INVALID_VALUE 0

int array[LEN+1]={0};
int out[LEN+1]={0};
int N, s, m;

void init(int N)
{
    int i;
    
    for (i = 1; i <= N; i++)
    {
        array[i] = i;
    }
}

void print()
{
    int i;
    
    for (i = 1; i <= N; i++)
    {
        printf("%4d", array[i]);
    }
    printf("\n");
}

void print_out_seq()
{
    int i;
    
    for (i = 1; i <= N; i++)
    {
        printf("%4d", out[i]);
    }
    printf("\n");
}

int get_next_index(int index)
{
    int count = 0;

    if (index == N)
    {
        index = 1;
    }
    else
    {
        index++;
    }

    while (array[index] < INVALID_VALUE)
    {
        index++;
        count++;
        if (index > N)
        {
            index = 1;
        }
        if (count == 8)
        {
            return 0;
        }
    }
    return index;
}

void josephus_seq(int id, int start, int count)
{
    int i;
    int index;

    if (id > N)
    {
        return ;
    }
    
    index = start;
    i = count - 1;
    while (i > 0)
    {
        index++;
        if (index > N)
        {
            index = 1;
        }

        if (array[index] > INVALID_VALUE)
        {
            i--;
        }
        //index = (index + 1)%N;
    }

    out[id] = array[index];

    array[index] = INVALID_VALUE - id;
    
//    print();

    index = get_next_index(index);

    josephus_seq(id+1, index, count);
}

int main ()
{
    scanf("%d%d%d", &N, &s, &m);
    init(N);
    
    josephus_seq(1, s, m);

    print_out_seq();
    return 0;
}
